package com.azure.apachedubbo.consumer.controller;

import com.azure.apachedubbo.api.service.DemoUserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * @Author: liuhuaibin
 * @Date: 2019/2/23 17:36
 * @Description:
 */

@RestController
@RequestMapping("/user")
public class UserController {
    //@Reference(version = "1.0", url = "dubbo://127.0.0.1:12345") //本地开发使用，服务直连
    @Reference(version = "${demo.service.version}", group = "${demo.service.group}") //连接zookeeper获取服务链接
    private DemoUserService demoUserService;

    @RequestMapping("/all")
    public String findAll(){
        return demoUserService.findAll().toString();
    }
}
